package com.ck.controller.admin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.ck.service.AdminService;

public class DeleteTeacherController extends AbstractController {

	private AdminService adminService;

	public void setAdminService(AdminService adminService) {
		this.adminService = adminService;
	}

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		
		Integer teacherID = Integer.parseInt(request.getParameter("teacherID"));
		adminService.deleteTeacher(teacherID);
		
		return new ModelAndView("admin/deleteTeacherSuccess");
	}

}
